var schedule = require('node-schedule');
let dbConfig = require('../utils/dbconfig');

let request = require('request');

const setToken = async (data) => {
    const { token, id } = data
    let sql = `update qinglong set token =? where id = ? `
    let sqlArr = [token, id]
    let result = await dbConfig.SySqlConnect(sql, sqlArr)
    if (result && result.affectedRows) {
        console.log('success')
    }
}
function scheduleCronstyle() {
    schedule.scheduleJob('30 5 * * * *', function () {
        getBearerToken()
    });
}
module.exports = scheduleCronstyle